package cc.ufinity.networkdiagnose.view;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import cc.ufinity.networkdiagnose.service.TaskService;

public class StartService extends BroadcastReceiver { 
	// 开机启动服务，程序需安装在内存中，不能在sd卡；sd卡在系统发出android.intent.action.BOOT_COMPLETED广播后才加载
	final static String TAG = "StartTaskService";

	@Override
	public void onReceive(Context context, Intent intent) {

		String action = intent.getAction();
		if (action.equals("android.intent.action.BOOT_COMPLETED")) {
			Intent serviceIntent = new Intent(context, TaskService.class);
			context.startService(serviceIntent);
		}
	}
}
